package com.easy.west.westclient.api.search.api;

import android.content.Context;
import android.support.annotation.NonNull;

import com.easy.west.westclient.api.base.callback.BaseCallBack;
import com.easy.west.westclient.api.base.impl.BaseImpl;
import com.easy.west.westclient.api.search.bean.SearchList;
import com.easy.west.westclient.api.search.event.SearchEvent;
import com.easy.west.westclient.util.UUIDGenerator;

public class SearchImpl extends BaseImpl<SearchService> implements SearchApi{

    public SearchImpl(@NonNull Context context) {
        super(context);
    }

    /**
     * 注释见接口
     * @param name
     * @return
     */
    @Override
    public String search(String name) {
        String uuid = UUIDGenerator.getUUID();
        service.search(name).enqueue(new BaseCallBack<SearchList>(new SearchEvent(uuid)));
        return uuid;
    }
}
